using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sio.Mdm.Server;
using Sio.Mdm.Types.Database;
using Sio.Mdm.BF.Administracija;
using Sio.Mdm.BL.Base;
using Sio.Mdm.Types;
using Sio.Mdm.Entities;

namespace Sio.Mdm.BL.Administracija
{
    [Service(Name = "AdministratorjiService", DefaultInterface = typeof(IAdministratorjiService))]
    public class AdministratorjiService : BaseFirebird<Sio.Mdm.Types.Database.Administrator>, IAdministratorjiService
    {
        public AdministratorjiService()
            : base("IDM")
        {
        }

        #region IAdministratorjiService Members

        public Result DodajVlogoNaOrganizacijo(int OrganizacijaId, int IdmStevilka)
        {
            EntityCollection<Sio.Mdm.Types.Database.Administrator> adminList = new EntityCollection<Sio.Mdm.Types.Database.Administrator>(
                new Filter<Sio.Mdm.Types.Database.Administrator>().Where(r => r.IdmStevilka == IdmStevilka && r.OrganizacijaId == 0));
            if (adminList.Count() == 1)
            {
                var admin = adminList.First();

            }

            return null;
        }

        public Result OdstraniVlogoIzOrganizacije(int OrganizacijaId, int IdmStevilka)
        {

            return null;
        }

        #endregion
    }
}
